loginHis = function(){
	var roleS = getStaticDataStore('role');

	//角色
	var role = new Ext.form.ComboBox({
		                 fieldLabel: '角色',width: 200,
		                 store: roleS,
		                 displayField: 'valueName',
		                 valueField: 'valueId',
		                 triggerAction: 'all',labelWidth:40,
		                 id:'role'
		                 //emptyText: '请选择...',
		                // allowBlank: false,
		               ///  blankText: '请选择政治面貌',
		               //  editable: false
		                 //width:100
		              //   mode: 'local'
		                	 });
	//账号
	var account ={
			width: 200,
			xtype: 'textfield',
			id: 'account',
			labelWidth:40,
			fieldLabel: '账号'	
		}

	var stateS = getStaticDataStore("successOfailure");
	//状体
	var state = new Ext.form.ComboBox({
		                 fieldLabel: '状态',width: 200,
		                 store: stateS,
		                 id:'state',
		                 displayField: 'valueName',
		                 valueField: 'valueId',
		                 triggerAction: 'all',
		                 //emptyText: '请选择...',
		                // allowBlank: false,
		               ///  blankText: '请选择政治面貌',
		                 editable: false,
		                 labelWidth:40,
		              //   mode: 'local'
		                	 });
	//开始日期
	var date1 ={
			width: 200,
			xtype: 'datefield',
			id: 'date1',
			labelWidth:60,
			fieldLabel: '开始日期',
			format: 'Y-m-d'
		}
	//结束日期
	var date2 ={
			width: 200,
			xtype: 'datefield',
			id: 'date2',
			labelWidth:60,
			fieldLabel: '结束日期'	,
			format: 'Y-m-d',
		    maxValue: new Date()  
		}
	//
/*	var condiction = {
	        //columnWidth: .30,
	       // height:150,
	        
	        xtype:'panel',
	        border:false,
	        style:'margin-left:50px;margin-top:50px',
	        items: [
	                role,
	                account,
	                date1,
	                date2
	                ]
		};*/
	var rowmn1 = {
	       //columnWidth: .30,
	       // height:150,
	        layout: 'column',
			/*region:'center',
    		layout: {
    		    type: 'hbox',
    		    align: 'middle ',
    		    pack: 'center'
    		},*/
	        xtype:'panel',
	        border:false,
	       // style:'margin-left:50px;margin-top:50px',
	       /* fieldDefaults: {
		        labelWidth:40,
		        anchor: '100%'
		    },*/
	        items: [
					role,
					account,
					state,
					date1,
					date2
	                ]
		};
	var rowmn2 = {
		       //columnWidth: .30,
		       // height:150,
		        layout: 'column',
		        xtype:'panel',
		        border:false,
		       // style:'margin-left:50px;margin-top:50px',
		        items: [
						/*date1,
						date2*/
		                ]
			};
	
	Ext.define('studentModel',{
		extend:'Ext.data.Model',
		fields:[ 
		        	{name:'id',type:'String'},
		        	{name:'role',type:'String'},
		        	{name:'account',type:'string'},
		        	{name:'loginDate',type:'string'},
		        	{name:'state',type:'String'},
			        {name:'exceptionTxt',type:'string'}
			       
			       ],
		idProperty : 'id'
	});
	

	var store = Ext.create('Ext.data.Store',{
		pageSize:10,
		model:studentModel,
		autoLoad:true,
		proxy:{
			type:'ajax',
			url:'qryLoginHisAction.action',
			reader:{
				type:'json',
				root:'resultsList.list',
				totalProperty:'resultsList.total'
			}
		}
	});
	var checkBox = Ext.create('Ext.selection.CheckboxModel');
	
	var grid = Ext.create('Ext.grid.Panel',{
		store:store,	
		columnLines:true,
		selModel:checkBox,
		disableSelection:false,
		width:'100%',
		loadMask:true,
	
		columns:[
		         {text:'编号',width:100,dataIndex:'id',sortable:true,editor:{allowBlank : false}},
		         {text:'角色',width:150,dataIndex:'role',sortable:true,renderer:function(v){
        			 var index = roleS.find('valueId',v); 
        			 if(index != -1){
        				 var r = roleS.getAt(index);
        				 return r.get("valueName");
        			 }
        			 else{
        				 return v;
        			 }
        		 } 
		         },
		         {text:'账号',width:150,dataIndex:'account',sortable:true},
		         {text:'登录时间',width:150,dataIndex:'loginDate',sortable:true,renderer:function(v){
		        	return  v.replace("T"," ").substring(0,16);
		         }},
		         {text:'登录结果',width:150,dataIndex:'state',sortable:true,renderer:function(v){
		        	 
        			 var index = stateS.find('valueId',v); 
        			 if(index != -1){
        				 var r = stateS.getAt(index);
        				 return r.get("valueName");
        			 }
        			 else{
        				 return v;
        			 }
        		 } 
		         },
		         {text:'异常信息',width:150,dataIndex:'exceptionTxt',sortable:true,editor:{allowBlank : false}},
		         ],
		autoHeight:true,
		authWidth:true,

		title:"登录历史记录列表",
		loadMask:true,
		pageSize:5,
		dockedItems:[
		{
			dock:'bottom',
			xtype:'pagingtoolbar',	
			store:store,
			displayInfo:true,
			displayMsg:'显示{0}-{1}条，共计{2}条',
			emptyMsg:"没有数据"
		}]
	});
	var condiction = Ext.create('Ext.FormPanel', {
	    title: '查询条件',
	    layout: 'form',
	    frame: true,
	   
	    width: '100%',
	    id:"condition",
	   // renderTo:'form-ct',
	    bodyPadding: 10,
	    items: [
				rowmn1,
				//rowmn2
				
	    ],
	    buttons: [{
	        text: '查询',
	        handler: function(){
	        	var role =  Ext.getCmp('role').getValue();
	        	var account =  Ext.getCmp('account').getValue();
	        	var date1 =  Ext.getCmp('date1').getValue();
	        	var date2 =  Ext.getCmp('date2').getValue();
	        	var state = Ext.getCmp('state').getValue();
	        	//var str = "role:"+role;
	        	store.load({
	        		
      		      params:{
      		    	  page:0,
      		    	  limit:0,
      		    	  role:role,
      		    	  state:state,
      		    	  account:account,
      		    	  date1:date1,
      		    	  date2:date2
      		      },   //参数
      		           // callback是加载完毕时执行的回调函数，它包含3个参数：records参数表示获得的数据，
      		         // options表示执行load()时传递的参数，success表示是否加载成功。
      		      callback: function(records, options, success){
      		                 //Ext.Msg.alert('info', '加载完毕');
      		        },
      		       scope: store,       //Scope用来指定回调函数执行时的作用域
      		       add: false             //Add为true时，load()得到的数据会添加在原来的store数据的末尾，
      		                                    //否则会先清除之前的数据，再将得到的数据添加到store中
	        	});
	        }
	    },{
	        text: '重置',
	        handler: function(){
	           // fp.getForm().reset();
	        	Ext.getCmp('condition').form.reset();
	        }
	    }],
	    buttonAlign : "center"
	});
	var form = new Ext.panel.Panel({
	                 frame: true,
	               //  title: '表单标题',
	                 region:'center',
	                 layout: {
	                	    type: 'vbox',
	                	    align: 'middle ',
	                	    pack: 'center'
	                	},
	                // style: 'margin:10px',
	                // html: '<div style="padding:10px">这里表单内容</div>',
	                items: [condiction, grid]
	             });
	return form;
}